<?php
namespace app\lib\exception;

use think\Exception;

class ApiException extends Exception
{
    // http 的状态码是 404 or 200
    public $statusCode;
    // 错误的具体信息
    public $message;
    // 自定义的状态码
    public $errorCode;
    // 错误等级
    public $level;
    
    public function __construct($message = '参数错误！', $statusCode = 404, $level = 'DEBUG', $errorCode = 1000){
        $this->message = $message;
        $this->statusCode = $statusCode;
        $this->level = $level;
        $this->errorCode = $errorCode;
    }
}
